{include file="public/nheader" /}
<div class="layui-fluid">
    <div class="layui-card">
        <!-- // 默认操作按钮 -->
        <div class="layui-card-header layadmin-card-header-auto ">
            <div class="layui-form">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-input-inline ">
                            <select name="type" lay-verify="">
                                <option value="">类型</option>
                                <option value="1" {if !empty(input('get.type')) && input('get.type')==1}selected{/if}>
                                    预约考察</option>
                                <option value="2" {if !empty(input('get.type')) && input('get.type')==2}selected{/if}>
                                    入场报名</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline ">
                            <select name="payment" lay-verify="">
                                <option value="">支付方式</option>
                                <option value="1" {if !empty(input('get.payment')) &&
                                    input('get.payment')==1}selected{/if}>
                                    微信</option>
                                <option value="2" {if !empty(input('get.payment')) &&
                                    input('get.payment')==2}selected{/if}>
                                    支付宝</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline ">
                            <select name="status" lay-verify="">
                                <option value="">状态</option>
                                <option value="1" {if !empty(input('get.status')) &&
                                    input('get.status')==1}selected{/if}>待付款</option>
                                <option value="2" {if !empty(input('get.status')) &&
                                    input('get.status')==2}selected{/if}>已付款</option>
                                <option value="3" {if !empty(input('get.status')) &&
                                    input('get.status')==3}selected{/if}>支付超时</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline ">
                            <select name="zsfxs" lay-verify="">
                                <option value="">赠送房型</option>
                                <option value="1" {if !empty(input('get.zsfxs')) && input('get.zsfxs')==1}selected{/if}>
                                    标准间</option>
                                <option value="2" {if !empty(input('get.zsfxs')) && input('get.zsfxs')==2}selected{/if}>
                                    大床房</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline ">
                            <input name="title" class="layui-input" type="text" placeholder="姓名|手机|公司|意向区域" />
                        </div>
                    </div>
                    <div class="layui-inline">
                        <!-- // 默认搜索 -->
                        <button class="layui-btn icon-btn" lay-filter="formSearch" lay-submit>搜索</button>
                    </div>
                </div>
            </div>
        </div>

        <!-- // 创建数据实例 -->
        <table id="lay-tableList" lay-filter="lay-tableList"></table>
    </div>
</div>
<!-- // 列表工具栏 -->
<script type="text/html" id="tableBar">
    <a class="layui-table-text" lay-open data-title="编辑" data-area="60%,80%" data-url="/agent/product_edit?id={{d.id}}&type=2" >编辑</a>
    <div class="layui-divider layui-divider-vertical"></div>
<a class="layui-table-text" data-url="/agent/product_del?id={{d.id}}" lay-event="del">删除</a>
</script>
{include file="public/nfooter"}
<script>
    layui.use(['table'], function () {
        var table = layui.table;
        /*
         * 初始化表格
        */
        var isTable = table.render({
            elem: "#lay-tableList"
            , url: "{:url()}"
            , page: true
            , size: 'lg'
            , even: true
            , toolbar: 'true'
            // , defaultToolbar: ["filter","exports","print"]
            , defaultToolbar: [{
                title: '导出excel' //标题
                , layEvent: 'LAYTABLE_EXPORT' //事件名，用于 toolbar 事件中使用
                , icon: 'layui-icon-export' //图标类名
            }, {
                title: '打印页面' //标题
                , layEvent: 'LAYTABLE_PRINT' //事件名，用于 toolbar 事件中使用
                , icon: 'layui-icon-print' //图标类名
            }, {
                title: '筛选数据' //标题
                , layEvent: 'LAYTABLE_COLS' //事件名，用于 toolbar 事件中使用
                , icon: 'layui-icon-cols' //图标类名
            }]
            , cols: [[
                { type: 'checkbox', width: 60 },
                { field: 'id', align: 'center', sort: true, width: 80, title: 'ID' },
                {
                    field: 'type', align: 'center', width: 100, templet: function (d) {
                        var text = '';
                        if (d.type == 1) {
                            text = '<span class="layui-badge layui-bg-blue">预约考察</span>';
                        }
                        if (d.type == 2) {
                            text = '<span class="layui-badge layui-bg-orange">入场报名</span>';
                        }
                        return text;

                    }, title: '类型'
                },
                {
                    field: 'name', align: 'center', width: 250, title: '姓名/电话/年龄', templet: function (d) {
                        return d.name + '/' + d.mobile + '/' + d.age;
                    }
                },
                {
                    field: 'gongsi', align: 'center', width: 250, title: '公司/职位/车牌', templet: function (d) {
                        if (d.type == 1) {
                            return d.gongsi + '/' + d.zhiwei;
                        }
                        if (d.type == 2) {
                            return d.gongsi + '/' + d.zhiwei + '/' + d.chepaihao;
                        }
                        return '无';
                    }
                },
                { field: 'yxhz', align: 'center', width: 200, title: '意向区域' },
                {
                    field: 'times', align: 'center', width: 200, title: '预约考察时间', templet: function (d) {
                        if (d.type == 1) {
                            return d.times;
                        }
                        return '无';
                    }
                },
                {
                    field: 'zsfxs', align: 'center', width: 120, title: '房型', templet: function (d) {
                        if (d.type == 2) {
                            if (d.zsfxs == 1) {
                                return '标准间';
                            }
                            if (d.zsfxs == 2) {
                                return '大床房';
                            }
                        }
                        return '无';
                    }
                },
                {
                    field: 'payment', align: 'center', width: 120, title: '支付方式', templet: function (d) {
                        if (d.payment == 1) {
                            return '微信支付';
                        }
                        if (d.payment == 2) {
                            return '支付宝支付';
                        }
                        return '无';
                    }
                },
                { field: 'total', align: 'center', width: 120, title: '支付价格' },
                {
                    field: 'status', align: 'center', width: 200, title: '状态', templet: function (d) {
                        if (d.status == 1) {
                            return '待付款(1分钟未付款取消)';
                        }
                        if (d.status == 2) {
                            return '已预约';
                        }
                        if (d.status == 3) {
                            return '付款超时';
                        }
                        return '无';
                    }
                },
                { field: 'product', align: 'center', width: 200, title: '项目' },
                { field: 'created', width: 200, align: 'center', title: '时间' },
            ]]
        })
    })
</script>
</body>